FROM osgeo/gdal:ubuntu-small-3.6.3
# docker image containing all tools in order to transform a GeoTIFF into a PNG terrain tileset

LABEL MAINTAINER manyhappy163@163.com

ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

RUN apt-get -y update && apt-get install -y --fix-missing python3-pip vim proj-bin nodejs \
    && apt-get install -y --fix-missing libboost-filesystem-dev libboost-iostreams-dev libboost-program-options-dev \
    && apt-get install -y --fix-missing libboost-system-dev  liblua5.1-0 liblua5.1-0-dev libprotobuf-dev libshp-dev \
    && apt-get install -y --fix-missing libsqlite3-dev protobuf-compiler rapidjson-dev \
    && pip3 install rasterio \
    && pip3 install rio-rgbify \
    && pip3 install rio-mbtiles \
    && pip3 install mbutil lxml ogr2osm \
    && npm i dem2terrain -g \
    && apt-get clean
# 源码编译安装tilemaker
RUN mkdir -p /tmp/tilemaker \
    && git clone https://gitee.com/dxnima/tilemaker.git /tmp/tilemaker
WORKDIR /tmp/tilemaker
RUN make && make install && make

# 源码编译安装tippecanoe
RUN mkdir -p /tmp/tippecanoe \
    && git clone https://gitee.com/dxnima/tippecanoe.git /tmp/tippecanoe
WORKDIR /tmp/tippecanoe
RUN make && make install
WORKDIR /data

# 卸载不需要的包减小镜像体积
RUN apt-get -y remove --purge pip curl \
    && apt-get -y autoremove